//定义一个二维数组[6][6]，将其对角线元素全变为0，并以矩阵方式输出

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
        int i,j;
        int a[6][6];
        srand(time(NULL));
        for (i=0;i<6;i++)
                for (j=0;j<6;j++)
                {
                        a[i][j]=rand()%100;
                }
	for (i=0;i<6;i++)
	{
		for (j=0;j<6;j++)
			printf("%2d ",a[i][j]);
		printf("\n");
	}
	printf("=============================\n");
	for (i=0;i<6;i++)
                for (j=0;j<6;j++)
			if (i==j||i+j==5)
				a[i][j]=0;
	 for (i=0;i<6;i++)
        {
                for (j=0;j<6;j++)
                        printf("%2d ",a[i][j]);
                printf("\n");
        }
	
	 return 0 ;
}

//diwutiantang@diwutiantang-VirtualBox:~/snap/lc/1218/zuoye/07-2wei$ ./2
//21 48  6 30 94 20 
//66  3 73 62  6 73 
//10  8 31 81 67 65 
//72 26 40 91 71 97 
//78 35 55 37 91 93 
//49 65 93  7 95 87 
//=============================
// 0 48  6 30 94  0 
//66  0 73 62  0 73 
//10  8  0  0 67 65 
//72 26  0  0 71 97 
//78  0 55 37  0 93 
// 0 65 93  7 95  0 
	

 
